messages = {
	{
		define = "struct", name = "DBPlayer",
		attributes =
		{
			{type="int32", name="pid", default = 0},
			{type="string", name="name"},
			{type="int8", name="gender", default = 0},
			{type="int8", name="features", default = 0},
			{type="int32", name="money_g", default = 0},
			{type="int32", name="money_s", default = 0},
			{type="int16", name="prop_vit", default = 0},
			{type="int16", name="prop_str", default = 0},
			{type="int16", name="prop_agi", default = 0},
			{type="int16", name="prop_int", default = 0},
			{type="int16", name="prop_left", default = 0},
			{type="int32", name="datax", default = 0},
			{type="int32", name="datay", default = 0},
			{type="int32", name="dataz", default = 0},
		}
	},
	{
		define = "struct", name = "DBPlayerEx",
		attributes =
		{
			{type="int32", name="pid", default = 0},
			{type="int16", name="hid", default = 0},
			{type="string", name="name"},
			{type="int8", name="gender", default = 0},
			{type="int8", name="features", default = 0},
			{type="int16", name="lvl", default = 0},
			{type="int16", name="elvl", default = 0},
			{type="int8", name="cid", default = 0},
			{type="int8", name="did", default = 0},
			{type="int8", name="sid", default = 0},
		}
	},
	{
		define = "msg", name="LoadPlayers", category = "Msg::MC_DB_Player", id = 10, base = "DBMessage",
		 attributes =
		 {
			 {type="int32", name = "aid", default = 0},
			 {type="DBPlayer", name = "players", list = true},
		 },
		 handler =
		 {
			 sql = "load_players(%d)",
			 input = {"aid"},
			 output={list = true, type = "DBPlayer", variable = "players","pid", "name",
			 "gender","features", "money_g", "money_s",
			 "prop_vit", "prop_str", "prop_agi", "prop_int","datax", "datay", "dataz"}
		 }
	},
	{
		define = "msg", name="LoadPlayersEx", category = "Msg::MC_DB_Player", id = 11, base = "DBMessage",
		 attributes =
		 {
			 {type="int32", name = "aid", default = 0},
			 {type="DBPlayerEx", name = "players", list = true},
		 },
		 handler =
		 {
			 sql = "load_players_ex(%d)",
			 input = {"aid"},
			 output={list = true, type = "DBPlayerEx", variable = "players","pid", "hid", "name","gender","features", "lvl", "elvl", "cid", "did", "sid"}
		 }
	 },
	{
		define = "msg", name="CreatePlayer", category = "Msg::MC_DB_Player", id = 20, base = "DBMessage",
		 attributes =
		 {
			 {type="int32", name = "aid", default = 0},
			 {type="DBPlayer", name = "player"},
		 },
		 handler =
		 {
			 sql = "create_player(%d, %d, \\'%s\\', %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d)",
			 input = {variable="player", "pid","aid", "name.c_str()",
			 "gender","features", "money_g", "money_s",
			 "prop_vit", "prop_str", "prop_agi", "prop_int", "prop_left", "datax", "datay", "dataz"},
		 }
	},
	{
		define = "msg", name="CreatePlayerEx", category = "Msg::MC_DB_Player", id = 21, base = "DBMessage",
		 attributes =
		 {
			{type="int32", name="pid", default = 0},
			{type="int32", name="aid", default = 0},
			{type="int16", name="hid", default = 0},
			{type="string", name="name"},
			{type="int8", name="gender", default = 0},
			{type="int8", name="features", default = 0},
			{type="int8", name="cid", default = 0},
			{type="int8", name="did", default = 0},
			{type="int8", name="sid", default = 0},
		 },
		 handler =
		 {
			 sql = "create_player_ex(%d, %d, %d, \\'%s\\', %d, %d, %d, %d, %d)",
			 input = {"pid", "aid", "hid", "name.c_str()", "gender", "features", "cid", "did", "sid"},
			 output={variable = "msg->pid","pid"}
		 }
	},
	{
		define = "msg", name="UpdatePlayer", category = "Msg::MC_DB_Player", id = 32, base = "DBMessage",
		 attributes =
		 {
			{type="int32", name="aid", default = 0},
			 {type="DBPlayer", name = "player"},
		 },
		 handler =
		 {
			 sql = "update_player(%d, %d, %d, %s, %c, %c, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d)",
			 input = {variable="player","pid", "aid", "name",
			 "gender","features", "money_g", "money_s",
			 "prop_vit", "prop_str", "prop_agi", "prop_int","datax", "datay", "dataz"},
		 }
	},
	{
		define = "msg", name="UpdatePlayerProps", category = "Msg::MC_DB_Player", id = 30, base = "DBMessage",
		 attributes =
		 {
			 {type="int32", name = "pid", default = 0},
			{type="int16", name="prop_vit", default = 0},
			{type="int16", name="prop_str", default = 0},
			{type="int16", name="prop_agi", default = 0},
			{type="int16", name="prop_int", default = 0},
			{type="int16", name="prop_left", default = 0},
		 },
		 handler =
		 {
			 sql = "update_player_props(%d, %d, %d, %d, %d, %d)",
			 input = {"pid", "prop_vit", "prop_str", "prop_agi", "prop_int","prop_left"},
		 }
	},
	{
		define = "msg", name="UpdatePlayerMoney", category = "Msg::MC_DB_Player", id = 31, base = "DBMessage",
		 attributes =
		 {
			 {type="int32", name = "pid"},
			 {type="int32", name = "money_s"},
			 {type="int32", name = "money_g"},
		 },
		 handler =
		 {
			 sql = "update_player_money(%d, %d, %d)",
			 input = {"pid", "money_g", "money_s"},
		 }
	},
	{
		define = "msg", name="RemovePlayer", category = "Msg::MC_DB_Player", id = 40, base = "DBMessage",
		 attributes =
		 {
			 {type="int32", name = "pid"},
		 },
		 handler =
		 {
			 sql = "remove_player(%d)",
			 input = {"pid"},
		 }
	 },
}

